function goods_FormuLaSearch() {
    clearErrorMsg();
    goods_search(1, "", "", "1");
    setSearchOrder("orderHead");
}
function goods_search(intCurPage, strOrderColumn, strOrder, strFlag, pageSize) {
    if(strFlag == "1") {
        ajaxRequest(getHost()+"goods/goodsFormulaList/search", {
            "curPage"       : intCurPage,
            "pageSize"      : pageSize,
            "FromulaName"   : getValue("txtFromulaName"),
            "Flag"          : strFlag
        }, goods_goodsListView);
    } else {
        ajaxRequest(getHost()+"goods/goodsFormulaList/search", {
            "curPage"       : intCurPage,
            "pageSize"      : pageSize,
            "orderColumn"   : strOrderColumn,
            "order"         : strOrder,
            "Flag"          : strFlag
        }, goods_goodsListView);
    }
}
function goods_goodsListView(data) {
    var arrMsg = new Array();
    if (data.count <= 0){
        
//        pageCreat(data.curPage,data.count,"pageFoot");
        setTableData("tblDataTable", data.searchData, null, null);
        pageCreat(1,data.count,"pageHead");
        arrMsg[arrMsg.length] = getMessage("ERR-100002");
    } 
    if(arrMsg.length>0){
        setErrorMsg(arrMsg, 600);
        return;
    }
    arrCols = new Array(
            "setRowNo(_rowno)",
            "setHref(FORMULA_NO, FORMULA_NAME)"
            );
    arrColStyle = new Array(
            "text-align:center",
            "text-align:center"
            );
    arrRows =new Array(
            "",
            "BListTableGray");
    pageCreat(data.curPage,data.count,"pageHead");
//    pageCreat(data.curPage,data.count,"pageFoot");
    setTableData("tblDataTable", data.searchData, arrCols, arrColStyle,false,arrRows);

    
}
function setRowNo(_rowno) {
    var intCurPage  = getCurPage();
    var intPageSize = getPageSize();
    return (intCurPage - 1) * intPageSize + _rowno + 1;
}
function setHref(FORMULA_NO, FORMULA_NAME) {
    return "<a  href=\"" + getHost()+"goods/goodsFormulaDetail/index/formulaNo/"+ FORMULA_NO + "\">" + FORMULA_NAME + "</a>";
}
function goods_addFormula() {
    document.goodsFormulaListFrom.action = getHost() + "goods/goodsFormula/index";
    document.goodsFormulaListFrom.submit();
}
function gotoPage(strPageContainerId, strOrderContainerId) {
    goods_search(getCurPage(strPageContainerId), getOrderColumn(strOrderContainerId), getOrder(strOrderContainerId), "2", getPageSize(strPageContainerId));
}

function firstPage(strPageContainerId, strOrderContainerId) {
    goods_search(getCurPage(strPageContainerId), getOrderColumn(strOrderContainerId), getOrder(strOrderContainerId), "2", getPageSize(strPageContainerId));
}

function prePage(strPageContainerId, strOrderContainerId) {
    goods_search(getCurPage(strPageContainerId), getOrderColumn(strOrderContainerId), getOrder(strOrderContainerId), "2", getPageSize(strPageContainerId));
}

function nextPage(strPageContainerId, strOrderContainerId) {
    goods_search(getCurPage(strPageContainerId), getOrderColumn(strOrderContainerId), getOrder(strOrderContainerId), "2", getPageSize(strPageContainerId));
}

function lastPage(strPageContainerId, strOrderContainerId) {
    goods_search(getCurPage(strPageContainerId), getOrderColumn(strOrderContainerId), getOrder(strOrderContainerId), "2", getPageSize(strPageContainerId));
}

function orderSearch(strPageContainerId, strOrderContainerId) {
    goods_search(getCurPage(strPageContainerId), getOrderColumn(strOrderContainerId), getOrder(strOrderContainerId), "2", getPageSize(strPageContainerId));
}
function sizeChangeSearch(strPageContainerId, strOrderContainerId) {
    goods_search(getCurPage(strPageContainerId), getOrderColumn(strOrderContainerId), getOrder(strOrderContainerId), "2", getPageSize(strPageContainerId));
}